<?php
include_once('baseModeldto.php');
include_once('itemInfodto.php');
include_once('itemStatusdto.php');
include_once('inventoryInfodto.php');
include_once('rentInformationdto.php');

include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/item.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/itemInfo.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/itemStatus.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/inventoryInfo.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/rentInformation.php');


class Itemdto extends BaseModeldto {
  public $id;
  public $identifier;
  public $ticketIdentifier;
  public $ticketItemNumber;
  public $ticketItemInfo;
  public $itemInfo;
  public $rentInformation;
  public $itemStatus;
  //public $rfidInfo;
  public $inventoryInfo;
  
  function resolveRelations() {
    
    $itemInfo = new ItemInfo();
    $itemInfo->loadByItemId($this->id);
    $this->itemInfo = new ItemInfodto($itemInfo);
    
    $rentInformation = new RentInformation();
    $rentInformation->loadByItemId($this->id);
    $this->rentInformation = new RentInformationdto($rentInformation);
  
    $itemStatus = new ItemStatus();
    $itemStatus->loadByItemId($this->id);
    $this->itemStatus=new ItemStatusdto($itemStatus);
    
    $inventoryInfo = new InventoryInfo();
    $inventoryInfo->loadByItemId($this->id);
    $this->inventoryInfo = new inventoryInfodto($inventoryInfo);
  }

}
